<?php 
// Header
$this->left_menu = 'menu/'.$this->params['controller'];
$params = array();
if (isset($this->params['plugin'])) {
	$params['plugin'] = $this->params['plugin'];
} else {
	$params['plugin'] = null;
}
// -- Load CSS : Begin --
echo $this->Html->css('manage_editable_pages/add.css');
echo $this->Html->css('cake.form');
echo $this->Html->css('jstree/tree_component');
// -- Load CSS : End  --

// Load Javascript
echo $this->Html->script('ckeditor/ckeditor_basic');

if ($has_related_images):
echo $this->Html->script('ajaxfileupload');
endif;
?>

<div class='right_content'>
<?php 
$module_name = isset($category) ? $category['name'] : $configs['EditablePage']['global']['module_name'];
$plural = isset($category) ? $category['name'] : Inflector::pluralize($configs['EditablePage']['global']['module_name']);
?>
<div class="title_left_sidebar">
	<div class="text_title">
		<?php echo $configs['EditablePage']['text']['edit_page_title']?>
	</div>
	
</div>

<?php echo $session->flash()?>

<div class='cake_form'>
<?php 
echo $form->create('EditablePage', array(
	'url'	=>	
	$params + array(
		'controller'	=>	$this->params['controller'],	
		'action'		=>	'edit',
		$alias
	),
	'id'		=>	'add_page_form',
	'enctype'	=>	'multipart/form-data'
));
echo $form->input('id');
?>

<?php if ($configs['EditablePage']['description']['show']):?>
<table cellpadding='0' cellspacing='0' border='0' width='100%'>
<tr>
	<td class='label' valign='top'><?php __("Mô tả: ")?></td>
	<td>
		<?php
		echo $form->input('description', array('label'	=>	false, 'div'=>false, 'type'=>'textarea')); 
		echo $wysiwyg->render('EditablePage.description', 'ckeditor', $configs['EditablePage']['description_config']);
		?>
	</td>
</tr>
</table>
<?php endif;?>

<table cellpadding='0' cellspacing='0' border='0' width='100%'>
<tr>
	<td class='label' valign='top'><?php __("Nội dung: ")?></td>
	<td>
		<?php
		echo $form->input('content', array('label'	=>	false, 'div'=>false, 'type'=>'textarea')); 
		echo $wysiwyg->render('EditablePage.content', 'ckeditor', $configs['EditablePage']['content_config']);
		?>
	</td>
</tr>
</table>

<!-- Related Images : Begin -->
<?php 
if ($has_related_images):
echo $this->element('list_images', array(
'plugin'=>'related_images', 
'settings'=>array(
	'model'	=>	'EditablePage',
	'name'	=>	'editable_pages'
),
'related_images'	=>	$this->data['RelatedImage']
));
endif;
?>

<!-- Related Images : End -->
<?php
echo $form->end($configs['EditablePage']['text']['submit_edit_button']);
?>
<!-- Related Images : Begin -->
<?php 
if ($has_related_images):
echo $this->element('dialogs', array(
'plugin'=>'related_images', 
'settings'=>array(
	'model'	=>	'EditablePage',
	'name'	=>	'editable_pages'
)
));
endif;
?>
<!-- Related Images : End -->
</div>
</div>